package com.example.demo1101.demo1;

public class TestPriority {
    public static void main(String[] args) {
        PriorityDome t1 = new PriorityDome("线程1");
        PriorityDome t2 = new PriorityDome("线程2");
        PriorityDome t3 = new PriorityDome("线程3");
        t1.setPriority(1);
        t2.setPriority(5);
        t3.setPriority(10);


        t1.start();
        t2.start();
        t3.start();


    }
}

class PriorityDome extends Thread {
    PriorityDome(String name) {
        super(name);
    }

    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            System.out.println(Thread.currentThread().getName() + "********" + i);
        }

    }

}
